package Chapter8_polymorphism;

/**
 * Date: 2019/2/19
 * Time: 16:21
 * User: Driss.
 */
class Instrument {
    public void play(Note n){
        System.out.print("Instrument.play()");
    }
}

class Wind extends Instrument {
    //Redefine interface method:
    public void play(Note n) {
        System.out.println("wind.play() " + n);
    }
}

public class Mysic{
    public static void tune(Instrument i){
        i.play(Note.MIDDLE_C);
    }

    public static void main(String[] args) {
        Wind wind = new Wind();
        tune(wind);
    }
}
